#{extends 'include/base.html' /}
#{set title:'登陆' /}
<div class="simple_wrap">
    <div class="set_wrap">
        <div class="set_pass_header_line"></div>
        <h3 class="set_pass_header_title">用户登陆</h3>
        <div class="set_pass_input_pass">账号: <input type="text" name="account.account" id="account"/></div>
        <div class="reset_pass_input_pass">密码: <input type="password" name="account.password" id="password"/></div>
        <p class="register_err hidden" style="position:absolute; top: 70px; text-align: center; width: 100%; left: 0px;">错误</p>
        <button class="set_pass_commit" id="btn">提交</button>
    </div>
</div>
<script type="text/javascript">


    $('#btn').click(function () {
        var account = $('#account').val();
        var password = $('#password').val();
        var  data ={
            account:{
            }
        };
        data.account.account=account;
        data.account.password=password;
        $.post('@{Api.login()}', data, function(res) {
            console.log(res)
            if(res.result==1) {
                location.href="@{Application.index()}"
            }
            else {
                $('.register_err').text(res.data);
                $('.register_err').removeClass('hidden');
            }
        });
    });

</script>